home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 5_3.lha / 5_3 / 5_3tst.c < prev    next >
C/C++ Source or Header  |  1993-08-08  |  836b  |  40 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <stream.h>
  6. include <error.h>
  7.  
  8. include "5_3.h"    // class strset
  9. include "5_3a.c"    // strset::strset
  10. include "5_3b.c"    // strset::~strset
  11. include "5_3c.c"    // strset::insert
  12. include "5_3d.c"    // strset::member
  13.  
  14. har *x[] =
  15.  
  16.    "hello", "there", "this", "is", "a", "test", "of", "lists",
  17.    "the", "quick", "brown", "fox", "jumped", "over", "the", "lazy", "black", "dog", 0
  18. ;
  19.  
  20. ain()
  21.  
  22.    strset s(30);
  23.  
  24.    cout << "member(of) = " << s.member("of") << "\n";
  25.  
  26.    for (char **xp = x; *xp; xp++)
  27. s.insert(*xp);
  28.  
  29.    cout << "member(of) = " << s.member("of") << "\n";
  30.  
  31.    int i;
  32.    for (s.iterate(i); s.ok(i); )
  33. {
  34. cout << "i = " << i << ", '";
  35. char *t = s.next(i);
  36. cout << t << "'\n";
  37. }
  38.    return 0;
  39.  
  40.